package com.futureCloudMOM.controller.core.web.produce;

import com.futureCloudMOM.common.annotation.Anonymous;
import com.futureCloudMOM.common.annotation.Log;
import com.futureCloudMOM.common.core.page.TableDataInfo;
import com.futureCloudMOM.controller.core.controller.BaseApiController;
import com.futureCloudMOM.core.domain.ProduceTaskBillRoutingProcess;
import com.futureCloudMOM.core.service.ProduceTaskBillRoutingMaterialService;
import com.futureCloudMOM.core.service.ProduceTaskBillRoutingParamService;
import com.futureCloudMOM.core.service.ProduceTaskBillRoutingProcessService;
import com.futureCloudMOM.framework.web.domain.Server;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 文件名 ProduceTaskBillRoutingProcessController
 *
 * @since 2023/6/6 16:06
 */
@Api(tags = "生产订单工艺工序")
@RestController
@RequestMapping("produce/task_bill_routing_process")
public class ProduceTaskBillRoutingProcessController extends BaseApiController<ProduceTaskBillRoutingProcess, ProduceTaskBillRoutingProcess, ProduceTaskBillRoutingProcessService> {

    public ProduceTaskBillRoutingProcessController(ProduceTaskBillRoutingProcessService service) {
        super(service);
    }

    @Log(title = "根据订单工艺工序ID查询上料参数")
    @ApiOperation(value = "根据工艺工序ID查询上料参数")
    @GetMapping("materials/{id}")
    public TableDataInfo materials(@PathVariable("id") Long id) {
        startPage();
        return getDataTable(service.getTaskBillRoutingMaterialListByTaskBillId(id));
    }

    @Log(title = "根据订单工艺工序ID查询加工参数")
    @GetMapping("params/{id}")
    public TableDataInfo params(@PathVariable("id") Long id) {
        startPage();
        return getDataTable(service.getTaskBillRoutingParamListByTaskBillId(id));
    }

}
